USE EMODE

-- PRODUCT_PROMOTION_FACTS

GO
ALTER TABLE PRODUCT_PROMOTION_FACTS
	ADD CONSTRAINT FK_PPF_PL_PK 
		FOREIGN KEY (PROMOTION_KEY) REFERENCES PROMOTION_LOOKUP(PROMOTION_KEY)

GO
ALTER TABLE PRODUCT_PROMOTION_FACTS
	ADD CONSTRAINT FK_PPF_CYL_WK 
		FOREIGN KEY (WEEK_KEY) REFERENCES CALENDAR_YEAR_LOOKUP(WEEK_KEY)

GO
ALTER TABLE PRODUCT_PROMOTION_FACTS
	ADD CONSTRAINT FK_PPF_AL_AC 
		FOREIGN KEY (ARTICLE_CODE) REFERENCES ARTICLE_LOOKUP(ARTICLE_CODE)

-- ARTICLE_LOOKUP_CRITERIA

GO
ALTER TABLE ARTICLE_LOOKUP_CRITERIA
	ADD CONSTRAINT FK_ALC_AL_AC
		FOREIGN KEY (ARTICLE_CODE) REFERENCES ARTICLE_LOOKUP(ARTICLE_CODE)

-- SHOP_FACTS

GO
ALTER TABLE SHOP_FACTS
	ADD CONSTRAINT FK_SF_AL_AC 
		FOREIGN KEY (ARTICLE_CODE) REFERENCES ARTICLE_LOOKUP(ARTICLE_CODE)

GO
ALTER TABLE SHOP_FACTS
	ADD CONSTRAINT FK_SF_ACL_AC_CC
		FOREIGN KEY (ARTICLE_CODE, COLOR_CODE) REFERENCES ARTICLE_COLOR_LOOKUP(ARTICLE_CODE, COLOR_CODE)

GO
ALTER TABLE SHOP_FACTS
	ADD CONSTRAINT FK_SF_OL_SC
		FOREIGN KEY (SHOP_CODE) REFERENCES OUTLET_LOOKUP(SHOP_CODE)

GO
ALTER TABLE SHOP_FACTS
	ADD CONSTRAINT FK_SF_CYL_WK
		FOREIGN KEY (WEEK_KEY) REFERENCES CALENDAR_YEAR_LOOKUP(WEEK_KEY)